<template>
	<view style="margin: 48rpx;overflow-x: auto;">
		<rich-text user-select :selectable="true" :nodes="info"></rich-text>
	</view>
</template>

<script setup lang="ts">
	import { ref } from 'vue';
	import home from '../../api/home.js';
	import {
		onLoad
	} from '@dcloudio/uni-app'
	let info = ref('')
	const getIntroduction = async () => {
		const res = await home.getIntroduction()
		if(res.code === 200) {
			const regex = new RegExp('<img', 'gi')
			res.data.introduction = res.data.introduction.replace(regex, `<img class="rich"`)
			info.value = res.data.introduction
		}
	}
	onLoad(() => {
		getIntroduction()
	})
</script>

<style scoped lang="scss">
	:deep(.rich){
		max-width: calc(100vw - 96rpx) !important;
	}
</style>